package com.lcxw.hxzbapi.dao.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import com.lcxw.hxzbapi.entity.pojo.RichLevel;

@Component
@Mapper
public interface RichLevelMapper {

    @Delete({
        "delete from ywpd_richlevel",
        "where `id` = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id) throws Exception;

    @Insert({
        "insert into ywpd_richlevel (`level`, `name`,  picUrl,",
        "`min`, `max`)",
        "values (#{level}, #{name}, #{picUrl},",
        "#{min}, #{max})"
    })
    int insert(RichLevel richLevel) throws Exception;

    @Select({
        "select",
        "*",
        "from ywpd_richlevel",
        "where `id` = #{id}"
    })
    RichLevel selectByPrimaryKey(Integer id) throws Exception;

    @Select("SELECT * FROM ywpd_richlevel")
    List<RichLevel> selectAll();


    @Update({
        "update ywpd_richlevel set ",
        "`level` = #{level},",
        "`name` = #{name},",
        "`picUrl` = #{picUrl},",
        "`min` = #{min},",
        "`max` = #{max}",
        "where `id` = #{id}"
    })
    int updateByPrimaryKey(RichLevel richLevel) throws Exception;

}
